/**
 * OWASP GoatDroid Project
 * 
 * This file is part of the Open Web Application Security Project (OWASP)
 * GoatDroid project. For details, please see
 * https://www.owasp.org/index.php/Projects/OWASP_GoatDroid_Project
 *
 * Copyright (c) 2011 - The OWASP Foundation
 * 
 * GoatDroid is published by OWASP under the GPLv3 license. You should read and accept the
 * LICENSE before you use, modify, and/or redistribute this software.
 * 
 * @author Jack Mannino, nVisium Security (https://www.nvisiumsecurity.com)
 * @created 2011
 */
package org.owasp.goatdroid.fourgoats.webservice.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.CookieParam;
import org.owasp.goatdroid.fourgoats.webservice.Constants;
import org.owasp.goatdroid.fourgoats.webservice.editpreferences.EditPreferencesImpl;
import org.owasp.goatdroid.fourgoats.webservice.editpreferences.beans.EditPreferencesBean;
import org.owasp.goatdroid.fourgoats.webservice.editpreferences.beans.GetPreferencesBean;

@Path("/fourgoats/api/v1/preferences")
public class EditPreferences {

	@Path("modify_preferences")
	@GET
	@Produces("application/json")
	public EditPreferencesBean modifyPreferences(
			@CookieParam(Constants.SESSION_TOKEN_NAME) String sessionToken,
			@QueryParam("autoCheckin") boolean autoCheckin,
			@QueryParam("isPublic") boolean isPublic) {

		return EditPreferencesImpl.modifyPreferences(sessionToken, autoCheckin,
				isPublic);
	}

	@Path("get_preferences")
	@GET
	@Produces("application/json")
	public GetPreferencesBean getPreferences(
			@CookieParam(Constants.SESSION_TOKEN_NAME) String sessionToken) {

		return EditPreferencesImpl.getPreferences(sessionToken);

	}
}
